This relates generally to electronic devices and, more particularly, to electronic devices with proximity sensors.
Electronic devices such as cellular telephones are sometimes provided with proximity sensors. For example, a cellular telephone may be provided with a proximity sensor that is located near an ear speaker on a front face of the cellular telephone. The front face of the cellular telephone may also contain a touch screen display. The proximity sensor may be used to determine when the cellular telephone is near to the head of a user. When not in proximity to the head of the user, the cellular telephone may be placed in a normal mode of operation in which the touch screen display is used to present visual information to the user and in which the touch sensor portion of the touch screen is enabled. In response to determining that the cellular telephone has been brought into the vicinity of the user's head, the display may be disabled to conserve power and the touch sensor on the display may be temporarily disabled to avoid inadvertent touch input from contact between the user's head and the touch sensor.
A proximity sensor for use in a cellular telephone may be based on an infrared light-emitting diode and a corresponding infrared photodiode. During operation, the light-emitting diode may emit infrared light outwards from the front face of the cellular telephone. The emitted light may be reflected from external objects such as the head of a user. When the cellular telephone is not in the vicinity of a user's head, the infrared light will not be reflected towards the photodiode and only small amounts of reflected light will be detected by the photodiode. When the cellular telephone is adjacent to the user's head, the emitted light from the infrared light-emitting diode will be reflected from the user's head and detected by the photodiode.
To reduce the impact of ambient light on the operation of a light-based proximity sensor, an alternating current (AC) signal may be used in driving the light-emitting diode. Corresponding detected signals from the photodiode detector may be filtered to separate direct current (DC) signals that are produced when ambient light illuminates the photodetector from the AC proximity sensor signal associated with the light-emitting diode.
Although DC signals can be filtered out of the photodetector signal, the performance of the photodetector in receiving the AC proximity sensor signal may be influenced by the magnitude of the DC signals. Temperature changes can also affect photodetector performance and light-emitting diode performance. Light-emitting diode current-to-optical-power conversion efficiency tends to decrease with increasing temperature and photodetector light-to-electrical current conversion efficiency tends to increase with increasing DC current from ambient light exposure. Environmental factors such as changes in ambient temperature and changes in ambient light exposure may therefore have an adverse impact on the accuracy of proximity sensor measurements.
It would therefore be desirable to be able to provide proximity sensors with enhanced immunity to environmental effects.